﻿using Microsoft.AspNet.FriendlyUrls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace WebApp
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            var settings = new FriendlyUrlSettings();
            settings.AutoRedirectMode = RedirectMode.Permanent;
            routes.EnableFriendlyUrls(settings);

            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
            routes.IgnoreRoute("");
            routes.MapRoute(
                name: "Default",
                //url: "{controller}/{action}/{id}",
                url: "{controller}/{id}",
                defaults: new { controller = "Idx", action = "Index", id = UrlParameter.Optional });
            //routes.RouteExistingFiles = true;
            
            //routes.MapRoute("Default", "{controller}/{id}");
        }
    }
}
